package com.cskaoyan.mall.service;

import com.cskaoyan.mall.bean.ProvinceAndCity;
import com.cskaoyan.mall.bean.Region;
import com.cskaoyan.mall.mapper.RegionMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RegionServiceImpl implements RegionService{

    @Resource
    private RegionMapper regionMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return regionMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Region record) {
        return regionMapper.insert(record);
    }

    @Override
    public int insertSelective(Region record) {
        return regionMapper.insertSelective(record);
    }

    @Override
    public Region selectByPrimaryKey(Integer id) {
        return regionMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Region record) {
        return regionMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Region record) {
        return regionMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<ProvinceAndCity> queryRegionList() {
        return regionMapper.selectAllRegionsByType();
    }

}
